#ifndef ARRAY_H
#define ARRAY_H

#include "SnapshotListFinder/slf.01.h"
#include "GadgetSnapshotIO/gsio.05.h"
#include "FoFReader/fofr.01.h"
#include "PotMinFinder/pmf.01.h"
#include "TextFileDecomposer/tfd.01.h"
#include "Vector/vector.03.h"
#include "Sorter/sorter.01.h"
//#include "FileNameDecomposer/fnd.02.h"



template <typename T=double> 
class Array {
	public:
		typedef unsigned int uint;
		
		Array(uint _N=0): p(0), N(_N) {   resize(_N); }
		~Array() {  if (p) delete [] p; }
		Array(const Array &a): p(0) { 
			resize(a.N); 
			memcpy(p, a.p, N*sizeof(*a.p)); 
		}
		
		uint N;
		T *p;
			
		T* operator =(T *_p)   {  p=_p; return p;  }
		operator T*(){	return p; }		
				
		void resize(uint _N){
			if (p) delete [] p;
			p = new T[_N];
			N=_N;
		}
		
		Array<T> &operator =(const Array<T> &a)  { 
			resize(a.N); 
			memcpy(p, a.p, N*sizeof(*a.p)); 
			return *this;
		}
		
		uint size(){
			return N;
		}
		
};


#endif;



  











